<template>
  <div class="make-media">
    <div 
      class="item" 
      v-for="(item, index) in list" 
      :key="index"
      :style="{'backgroundImage': 'url(' + item.url + ')'}"
    >
      <p class="mask" v-if="!item.isEnd"></p>
      <p 
        @click="toMakeMedia"
        class="to-make" 
        v-if="!item.isEnd">跟拍</p>
      <p class="status status-end" v-if="item.isEnd">已完成</p>
      <p class="status status-no-end" v-else>未完成</p>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [
        {
          url: 'http://oss.dev.shijiayun.cn/cpms/image/c562219804784dd487f5994531b08309.jpg',
          isEnd: false
        },
        {
          url: 'http://oss.dev.shijiayun.cn/cpms/image/c562219804784dd487f5994531b08309.jpg',
          isEnd: false
        },
        {
          url: 'http://oss.dev.shijiayun.cn/cpms/image/c562219804784dd487f5994531b08309.jpg',
          isEnd: true
        },
      ]
    }
  },
  methods: {
    toMakeMedia () {
      wx.miniProgram.navigateTo({
        url: '/pages/recordGuide/recordGuide?recordType=video',
      })
    },
  }
}
</script>

<style scoped>
.to-make {
  position: relative;
  width: 19.47vw;
  height: 7.47vw;
  text-align: center;
  line-height: 7.47vw;
  border-radius: 3.73vw;
  background: #0A67FF;
  font-family: Source Sans Pro;
  font-size: 3.73vw;
  font-weight: bold;
  color: #FFFFFF;
  z-index: 2;
}
.make-media {
  display: flex;
  justify-content: space-between;
  padding: 0 3.2vw;
  flex-wrap: wrap;
}
.status {
  position: absolute;
  right: 2.13vw;
  top: 2.67vw;
  width: 16.53vw;
  height: 5.87vw;
  line-height: 5.87vw;
  border-radius: 2.93vw;
  text-align: center;
  font-family: Source Sans Pro;
  font-size: 3.2vw;
  font-weight: 600;
  color: #FFFFFF;
  z-index: 2;
}
.status-end {
  background: #008924;
}
.status-no-end {
  background: #FF7628;
}
.item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45.6vw;
  height: 47.47vw;
  margin-bottom: 3.2vw;
  border-radius: 1.07vw;
  overflow: hidden;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.mask {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.3);
  z-index: 1;
}
</style>

